package org.zoomdev.zoom.dao;

import java.util.Collection;

public interface LambdaSql<T> extends Sql<EAr<T>> {


    <R> EAr<T> where(SFunction<T, R> key, Object value);

    <R> EAr<T> where(boolean condition, SFunction<T, R> func, Object value);

    <R> EAr<T> orWhere(SFunction<T, R> key, Object value);

    <R> EAr<T> orLike(SFunction<T, R> key, SqlBuilder.Like like, Object value);

    <R> EAr<T> like(SFunction<T, R> key, SqlBuilder.Like like, Object value);

    <R> EAr<T> like(boolean condition, SFunction<T, R> key, SqlBuilder.Like like, Object value);

    default EAr<T> like(boolean condition, String key, SqlBuilder.Like like, Object value){
        if(condition){
            return like(key,like,value);
        }
        return (EAr<T>)this;
    }

    <E> EAr<T> whereIn(SFunction<T, E> key, Collection<E> values);
}
